//  this library.
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hktk_app/util/font_util.dart';
import 'package:hktk_app/util/view_util.dart';

/// 自定义加载框
class CustomDialog extends Dialog {
  const CustomDialog({super.key});

  @override
  Widget build(BuildContext context) {
    double width = ScreenUtil().screenWidth;
    double height = ScreenUtil().screenHeight;
    return Container(
      width: width,
      height: height,
      color: colorBlack15,
      child: Center(
        // 创建透明层
        child: Material(
          type: MaterialType.transparency, //透明类型
          child: SizedBox(
            width: 240,
            height: 240,
            child: Container(
              decoration: ShapeDecoration(
                  color: colorBlack6,
                  shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.all(Radius.circular(20)))),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  SizedBox(
                    width: 70,
                    height: 70,
                    child: const CircularProgressIndicator(
                      color: colorWhite1,
                    ),
                  ),
                  Padding(
                    padding: EdgeInsets.only(top: 36),
                    child: Text(
                      "加载中",
                      style: FontUtil.fontWhile1(24),
                    ),
                  ),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
